import { defHttp } from '@/utils/http/axios'

enum Api {
  OrgPageList = '/org/page/list',
  AddorUpdateOrg = '/org/addOrUpdate',
  OrgBindDept = '/org/bind/dept',
  OrgDelete = '/org/delete',
  OrgDetail = '/org/detail',
  OrgTree = '/org/tree',
}

export const getOrgPageList = (data) => defHttp.post({ url: Api.OrgPageList, data })
export const addorUpdateOrg = (data) => defHttp.post({ url: Api.AddorUpdateOrg, data })
export const postOrgBindDept = (data) => defHttp.post({ url: Api.OrgBindDept, data })
export const deleteOrg = (orgId) => defHttp.get({ url: Api.OrgDelete, params: {orgId} })
export const getOrgDetail = (orgId) => defHttp.get({ url: Api.OrgDetail, params: {orgId} })
export const getOrgTree = () => defHttp.get({ url: Api.OrgTree })
